package com.example.exceldemo.controller;

import com.example.exceldemo.service.EasyExcelService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@Api(tags = "easyExcel导出")
@RequestMapping("easyExcel")
@RestController
public class EasyExcelExpController {

    @Autowired
    private EasyExcelService excelService;

    @GetMapping("export")
    @ApiOperation(value = "普通导出", produces = "application/octet-stream")
    public void excelExport() {
        excelService.export();
    }
    @GetMapping("exportHead")
    @ApiOperation(value = "普通导出加表头标题", produces = "application/octet-stream")
    public void exportHead() {
        excelService.exportHead();
    }
    @GetMapping("excelSetExport")
    @ApiOperation(value = "自定义导出样式", produces = "application/octet-stream")
    public void excelSetExport() {
        excelService.excelSetExport();
    }
    @GetMapping("exportSheet")
    @ApiOperation(value = "普通多sheet导出", produces = "application/octet-stream")
    public void exportSheet() {
        excelService.exportSheet();
    }
    @GetMapping("excelTemplate")
    @ApiOperation(value = "复杂模板导出", produces = "application/octet-stream")
    public void excelTemplate() {
        excelService.excelTemplate();
    }

    @GetMapping("commonTemplateExport")
    @ApiOperation(value = "普通模板导出", produces = "application/octet-stream")
    public void commonTemplateExport() {
        excelService.commonTemplateExport();
    }
    @GetMapping("excelTemplateSheet")
    @ApiOperation(value = "模板多sheet导出", produces = "application/octet-stream")
    public void excelTemplateSheet() {
        excelService.exportTemplateSheet();
    }

    @GetMapping("excelMergeExport")
    @ApiOperation(value = "合并单元格导出", produces = "application/octet-stream")
    public void excelMergeExport() {
        excelService.excelMergeExport();
    }

    @GetMapping("excelManyExport")
    @ApiOperation(value = "excel大量数据分批查询导出", produces = "application/octet-stream")
    public void excelManyExport() {
        excelService.excelManyExport();
    }

}